<template>
	<view>
		<view class="mine">
			<title title="我的信息" />

			<view class="mine-card">
				<view class="avatar">
					<image src="/static/svg/user.svg" mode=""></image>
				</view>
				<view class="message">
					<view class="name">
						{{userInfo.phoneNumber||"请先登录"}}
					</view>
					<view class="digest">
						013百俐测试御3
					</view>
				</view>
			</view>
			<view class="mine-exit">
				<u-button @click="pathGO" color="#2e586b" :text="userInfo?'退出登录':'跳转登录'"></u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: null
			};
		},
		onShow() {
			this.userInfo = uni.getStorageSync('userInfo')
		},
		methods: {
			pathGO() {
				uni.navigateTo({
					url: "../../pages/play/play?liveUrl=" + "ws:\\video.cimtech.cn:9080\jessica\live\aircraft_013",

				})
				let url = "ws://video.cimtech.cn:9080/jessica/live/aircraft_013"
				let newUrl = url.replaceAll("/", "\\")
				uni.setStorageSync('liveUrl', newUrl)
				// if (uni.getStorageSync('userInfo')) {
				// 	uni.showModal({
				// 		title: "确定退出登录？",
				// 		success: (res) => {
				// 			if (res.confirm) {
				// 				uni.removeStorageSync('userInfo')
				// 				this.userInfo = null
				// 				uni.navigateTo({
				// 					url: "../../loginPages/login/login",

				// 				})
				// 			} else {

				// 			}
				// 		}
				// 	})

				// }
			}
		},


	}
</script>

<style lang="scss">
	.mine {
		margin: 0 30rpx;

		.mine-card {
			width: 100%;
			height: 160rpx;
			background-color: white;
			box-shadow: 0px 3px 8px 0px #00000040;

			display: flex;
			align-items: center;
			margin: 30rpx 0;

			.avatar {
				height: 80rpx;
				width: 80rpx;
				border-radius: 50%;
				margin: 0 30rpx;
				overflow: hidden;

				image {
					height: 100%;
					width: 100%;
				}
			}
		}

		.mine-exit {
			margin-top: 44rpx;
		}
	}
</style>